<template>
    <div class="home">
        <div class="mentions">
            <div class="show-content">
                <ul class="head-link">
                    <li class="link-li">
                        <a href="#" class="link-a">
                            <img src="../assets/img/kuaikan.png" class="link-icon" />
                            <span class="link-text">快看视频</span>
                        </a>
                    </li>
                    <li class="link-li">
                        <a href="#" class="link-a">
                            <img src="../assets/img/kuaikan(1).png" class="link-icon" />
                            <span class="link-text">快看视频</span>
                        </a>
                    </li>
                    <li class="link-li">
                        <a href="#" class="link-a">
                            <img src="../assets/img/kuaikan(2).png" class="link-icon" />
                            <span class="link-text">快看视频</span>
                        </a>
                    </li>
                    <li class="link-li">
                        <a href="#" class="link-a">
                            <img src="../assets/img/kuaikan(3).png" class="link-icon" />
                            <span class="link-text">快看视频</span>
                        </a>
                    </li>
                    <li class="link-li">
                        <a href="#" class="link-a">
                            <img src="../assets/img/kuaikan(4).png" class="link-icon" />
                            <span class="link-text">快看视频</span>
                        </a>
                    </li>
                    <li class="link-li">
                        <a href="#" class="link-a">
                            <img src="../assets/img/kuaikan(5).png" class="link-icon" />
                            <span class="link-text">快看视频</span>
                        </a>
                    </li>
                    <li class="link-li">
                        <a href="#" class="link-a">
                            <img src="../assets/img/kuaikan(1).png" class="link-icon" />
                            <span class="link-text">快看视频</span>
                        </a>
                    </li>
                    <li class="link-li">
                        <a href="#" class="link-a">
                            <img src="../assets/img/kuaikan(2).png" class="link-icon" />
                            <span class="link-text">快看视频</span>
                        </a>
                    </li>
                    <li class="link-li">
                        <a href="#" class="link-a">
                            <img src="../assets/img/kuaikan(3).png" class="link-icon" />
                            <span class="link-text">快看视频</span>
                        </a>
                    </li>
                    <li class="link-li">
                        <a href="#" class="link-a">
                            <img src="../assets/img/kuaikan(4).png" class="link-icon" />
                            <span class="link-text">快看视频</span>
                        </a>
                    </li>
                </ul>
                <div class="packet">
                    <div class="limit-packet">
                        <img src="../assets/img/packet.png" class="icon" />
                        <span class="text">限时免费红包</span>
                    </div>
                    <div class="list-packet">
                        <div class="item-link">
                            <img src="../assets/img/meituan.png" />
                        </div>
                        <div class="item-link">
                            <img src="../assets/img/meituan.png" />
                        </div>
                        <div class="item-link">
                            <img src="../assets/img/meituan.png" />
                        </div>
                        <div class="item-link">
                            <img src="../assets/img/meituan.png" />
                        </div>
                    </div>
                </div>
                <div class="Welfare">
                    <div class="wel-item">
                        <div class="item-head">
                            <img src="../assets/img/huanguan.png" class="icon" />
                            <img src="../assets/img/huiyuanmiaosha.png" class="icon-text" />
                            <span class="time">05:39:22</span>
                        </div>
                        <div class="item-card">
                            <div class="card">
                                <div class="cover">
                                    <img src="../assets/img/weitu1.png" />
                                </div>
                                <div class="card-name">优酷视频</div>
                                <div class="card-price">
                                    <div class="new-price">
                                        <span>￥</span>7.4
                                    </div>
                                    <span class="old-price">￥10</span>
                                </div>
                            </div>
                            <div class="card">
                                <div class="cover">
                                    <img src="../assets/img/weitu1.png" />
                                </div>
                                <div class="card-name">优酷视频</div>
                                <div class="card-price">
                                    <div class="new-price">
                                        <span>￥</span>7.4
                                    </div>
                                    <span class="old-price">￥10</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="wel-item">
                        <div class="item-head">
                            <img src="../assets/img/dianzan.png" class="icon" />
                            <img src="../assets/img/chaozhijingxuan.png" class="icon-text" />
                            <span class="time">05:39:22</span>
                        </div>
                        <div class="item-card">
                            <div class="card">
                                <div class="cover">
                                    <img src="../assets/img/weitu1.png" />
                                </div>
                                <div class="card-name">优酷视频</div>
                                <div class="card-price">
                                    <div class="new-price">
                                        <span>￥</span>7.4
                                    </div>
                                    <span class="old-price">￥10</span>
                                </div>
                            </div>
                            <div class="card">
                                <div class="cover">
                                    <img src="../assets/img/weitu1.png" />
                                </div>
                                <div class="card-name">优酷视频</div>
                                <div class="card-price">
                                    <div class="new-price">
                                        <span>￥</span>7.4
                                    </div>
                                    <span class="old-price">￥10</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <van-tabs
                    v-model:active="active"
                    scrollspy
                    sticky
                    background="#fffaf4"
                    title-active-color="#FFFFFF"
                    title-inactive-color="#d0d0d0"
                    color="#df3030"
                    line-height="0"
                >
                    <van-tab v-for="index in 8" :title="'热门推荐' + index" title-class="tab-title">
                        <div class="tab-content">
                            <div class="con-title">
                                <span class="c-icon"></span>
                                <span class="c-text">热门推荐{{ index }}</span>
                            </div>
                            <ul class="tab-link">
                                <li class="link-li">
                                    <a href="#" class="link-a">
                                        <img src="../assets/img/kuaikan.png" class="link-icon" />
                                        <span class="link-text">快看视频</span>
                                    </a>
                                </li>
                                <li class="link-li">
                                    <a href="#" class="link-a">
                                        <img src="../assets/img/kuaikan(1).png" class="link-icon" />
                                        <span class="link-text">快看视频</span>
                                    </a>
                                </li>
                                <li class="link-li">
                                    <a href="#" class="link-a">
                                        <img src="../assets/img/kuaikan(2).png" class="link-icon" />
                                        <span class="link-text">快看视频</span>
                                    </a>
                                </li>
                                <li class="link-li">
                                    <a href="#" class="link-a">
                                        <img src="../assets/img/kuaikan(3).png" class="link-icon" />
                                        <span class="link-text">快看视频</span>
                                    </a>
                                </li>
                                <li class="link-li">
                                    <a href="#" class="link-a">
                                        <img src="../assets/img/kuaikan(4).png" class="link-icon" />
                                        <span class="link-text">快看视频</span>
                                    </a>
                                </li>
                                <li class="link-li">
                                    <a href="#" class="link-a">
                                        <img src="../assets/img/kuaikan(5).png" class="link-icon" />
                                        <span class="link-text">快看视频</span>
                                    </a>
                                </li>
                                <li class="link-li">
                                    <a href="#" class="link-a">
                                        <img src="../assets/img/kuaikan(1).png" class="link-icon" />
                                        <span class="link-text">快看视频</span>
                                    </a>
                                </li>
                                <li class="link-li">
                                    <a href="#" class="link-a">
                                        <img src="../assets/img/kuaikan(2).png" class="link-icon" />
                                        <span class="link-text">快看视频</span>
                                    </a>
                                </li>
            
                            </ul>
                        </div>
                    </van-tab>
                </van-tabs>
            </div>
        </div>
    </div>
    <Nav></Nav>
</template>



<script lang="ts" setup>
import { ref, onMounted, nextTick, reactive } from 'vue';
import { useStore } from '../store';
import Nav from '../components/nav.vue';
const store = useStore()
let data = reactive({
    count: 0
})
const active = ref(store.getters.getCount);
const add = () => {
    store.dispatch('increment');
    data.count = store.getters.getCount;
}
// console.log(store.state.count);

</script>

<style lang="less">
.home {
    // height: 100%;
    .mentions {
        background: #fffaf4 url("@/assets/img/top-bg.jpg") no-repeat top center;
        background-size: contain;
        padding-top: 182px;
        padding-bottom: 80px;
        height: 100%;
        box-sizing: content-box;
        .show-content {
            height: 100%;
            background: #fffaf4;
            border-radius: 22px;
            padding: 13px 8px;
            .head-link {
                display: flex;
                flex-wrap: wrap;
                list-style: none;
                padding: 10px 4.5px;
                background: #ffffff;
                border-radius: 5px;
                margin-bottom: 16px;
                .link-li {
                    width: 70px;
                    padding: 5px 0;
                    .link-a {
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        flex-direction: column;
                        .link-icon {
                            height: 38px;
                            width: 38px;
                            margin-bottom: 5px;
                        }

                        .link-text {
                            display: block;
                            height: 17px;
                            font-size: 12px;
                            font-family: PingFangSC-Regular, PingFang SC;
                            font-weight: 400;
                            color: #757575;
                            line-height: 20px;
                            text-align: center;
                        }
                    }
                }
            }
            .packet {
                background: #ffffff;
                border-radius: 4px;
                padding-bottom: 7px;
                margin-bottom: 10px;
                .limit-packet {
                    display: flex;
                    align-items: center;
                    height: 42px;
                    background: #fdefe9;
                    padding: 6px 3px;
                    margin-bottom: 11px;
                    .icon {
                        height: 30px;
                        width: 30px;
                        margin-right: 7px;
                    }

                    .text {
                        display: block;
                        font-size: 20px;
                        font-family: YouSheBiaoTiHei;
                        color: #df3030;
                        font-weight: 700;
                    }
                }
                .list-packet {
                    display: flex;
                    flex-wrap: nowrap;
                    overflow-y: scroll;
                    .item-link {
                        width: 145px;
                        height: 100px;
                        margin-right: 8px;
                        img {
                            width: 145px;
                            height: 100px;
                        }
                    }
                }
                .list-packet::-webkit-scrollbar {
                    display: none;
                }
            }

            .Welfare {
                display: flex;
                justify-content: space-between;
                margin-bottom: 16px;
                .wel-item {
                    width: 173px;
                    height: 159px;
                    background: #ffffff;
                    border-radius: 4px;
                    padding-bottom: 12px;
                    .item-head {
                        height: 35px;
                        background: #fdefe9;
                        display: flex;
                        align-items: center;
                        padding: 5px 3px;
                        border-radius: 4px 4px 0 0;
                        margin-bottom: 11px;
                        .icon {
                            width: 24px;
                            height: 24px;
                            margin-right: 3px;
                        }

                        .icon-text {
                            width: 70px;
                            height: 25px;
                        }

                        .time {
                            width: 68px;
                            height: 23px;
                            background: #ffffff;
                            border-radius: 12px;
                            border: 1px solid #df3030;
                            font-size: 12px;
                            font-family: PingFangSC-Semibold, PingFang SC;
                            font-weight: 600;
                            color: #df3030;
                            line-height: 23px;
                            text-align: center;
                        }
                    }

                    .item-card {
                        display: flex;
                        justify-content: space-between;
                        padding: 0 5px;
                        .card {
                            width: 78px;

                            .cover {
                                width: 78px;
                                height: 60px;
                                background: rgba(16, 36, 44, 0.04);
                                border-radius: 5px;
                                padding: 8px 6px 7px 5px;
                                img {
                                    width: 100%;
                                    height: 100%;
                                }
                            }

                            .card-name {
                                font-size: 12px;
                                font-family: PingFangSC-Regular, PingFang SC;
                                font-weight: 400;
                                color: #000000;
                                line-height: 20px;
                            }

                            .card-price {
                                display: flex;
                                .new-price {
                                    width: 36px;
                                    height: 18px;
                                    font-size: 13px;
                                    font-family: PingFangSC-Semibold,
                                        PingFang SC;
                                    font-weight: 600;
                                    color: #df3030;
                                    line-height: 18px;
                                    display: inline-block;
                                    span {
                                        font-size: 10px;
                                    }
                                }
                                .old-price {
                                    width: 21px;
                                    height: 18px;
                                    font-size: 13px;
                                    font-family: PingFangSC-Semibold,
                                        PingFang SC;
                                    font-weight: 600;
                                    color: #d0d0d0;
                                    line-height: 18px;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
.tab-title {
    width: 100px;
    // height: 32px;
    // background: #ff8a23 #df3030;
    // box-shadow: 0px 11px 15px 0px rgba(255, 138, 35, 0.2);
    background: #ffffff;
    border-radius: 65px;
    margin: 5px 13px 5px 0;
    span {
        font-size: 12px;
        font-family: PingFangSC-Semibold, PingFang SC;
        font-weight: 600;
        // color: #d0d0d0;
        line-height: 20px;
    }
}

.tab-content {
    margin-bottom: 12px;
    .con-title {
        display: flex;
        align-items: center;
        padding: 0 16px;
        margin-bottom: 6px;
        .c-icon {
            display: inline-block;
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #ff8a23;
            margin-right: 8px;
        }

        .c-text {
            font-size: 12px;
            font-family: PingFangSC-Semibold, PingFang SC;
            font-weight: 600;
            color: #ff8a23;
            line-height: 20px;
        }
    }
    .tab-link {
        display: flex;
        flex-wrap: wrap;
        list-style: none;
        padding: 10px 3.5px 7px;
        background: #ffffff;
        border-radius: 5px;
        margin-bottom: 16px;
        .link-li {
            width: 88px;
            padding: 5px 0;
            margin-bottom: 10px;
            .link-a {
                display: flex;
                justify-content: center;
                align-items: center;
                flex-direction: column;
                .link-icon {
                    height: 40px;
                    width: 40px;
                    margin-bottom: 5px;
                }

                .link-text {
                    display: block;
                    font-size: 12px;
                    font-family: PingFangSC-Regular, PingFang SC;
                    font-weight: 400;
                    color: #757575;
                    line-height: 20px;
                    text-align: center;
                }
            }
        }
    }
}
.tab-content:first-child {
    margin-top: 21px;
}

.van-tab--active {
    background-color: #df3030;
}
</style>